<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<title>${title}</title>
<%@include file="/WEB-INF/templates/common/common.jsp"%>
<script type="text/javascript" src="${basePath}/static/page/js/jqPaginator.js"></script>
<script type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
<script  type="text/javascript" src="${basePath}/static/js/util.js"></script>
<script  type="text/javascript" src="${basePath}/static/layer/layer.js"></script>
<link href="${basePath}/static/layer/layer_style.css" rel="stylesheet" type="text/css">
</head>
<body>

</head>
<body>
 <!--头部-->
 <%@include file="/WEB-INF/templates/common/header.jsp"%>

<!------导航条-->
 <%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<div class="list_main lay_out">
 <div class="list_DH">
    <!--打印模块导航栏-->
 <%@include file="/WEB-INF/templates/common/printnav.jsp"%>
 </div>
 <div class="list_NR">
  <div class="loc">
   <h3>打印统计</h3>
  </div>
 
  <div class="list_con_table"> 
   <div class="search_table">
    <ul id="table_ul">
     <li class="Label_1">打印时间：&nbsp;<span class="Label_6">*</span></li>
     <li class="Label_2" style="width:400px;text-align:left">
     <input style="width:175px;margin-left:5px" class="input_box" id="startTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" type="text"  name=''  value='' /> 
     - <input style="width:175px" class="input_box" id="endTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" type="text"  name=''  value='' />
     </li>
    
    <li class="Label_5">
	   <a onclick="printWorkTotal()">查询</a>
	   <a href="javaScript:exportExecl()">导出</a>
    </li>
    </ul>
  </div>
  <table class="Search_tableList" cellpadding="0" cellspacing="0">
		      <tr>
		      <td class="tdLabel_4">姓名</td>
		      <td class="tdLabel_4">识别码</td>
		      <td class="tdLabel_4">打印份数</td>
		      <td class="tdLabel_4">打印申请人</td>
		      <td class="tdLabel_4">打印时间</td>
		      </tr>
		      <tr id="loading" style="height:50px;display:none;border: none;">
	                 <td colspan="5" align="center" ><img src="${basePath}/static/layer/skin/default/loading-2.gif"></td>
	            </tr>
		      <tbody id="tbody">
		
		      </tbody>
     </table>
   
 </div>
</div>
</div>
<!--页脚部分-->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>
 <script>
 	function printWorkTotal(){
 		
 		var startTime=$("#startTime").val();
 		var endTime=$("#endTime").val();
 		
 		$.ajax({
 			type:"post",
 			url:"${basePath}/print/printWorkTotal",
 			data:{startTime:startTime,endTime:endTime},
 			beforeSend:function(){
 				$("#tbody").html("");
 				$("#loading").show();
 			},
 			success:function(data){
 				$("#loading").hide();
 				if(data.success){
 					var html="";
 					var printList=data.data;
 					for(var i=0;i<printList.length;i++){
 						var print=printList[i];
 						html+="<tr>"+
 						      "	<td class='tdLabel_5'>"+print.operator+"</td>"+
 						      " <td class='tdLabel_5'>"+print.totalPrintCopies+"</td>"+
 						      " <td class='tdLabel_5'>"+print.mailPrintCopies+"</td>"+
 						      "	<td class='tdLabel_5'>"+print.mailPrintCopiesRate+"</td>"+
 						      " <td class='tdLabel_5'>"+print.totalPrintPage+"</td>"+
 						   	  " <td class='tdLabel_5'>"+(print.mailPrintPges==undefined?0:print.mailPrintPges)+"</td>"+
 						  	  " <td class='tdLabel_5'>"+(print.mailPrintPageRate==undefined?0:print.mailPrintPageRate)+"</td>"+  
 						      "</tr>";
 					}
 					$("#tbody").html(html);
 				}else{
 					layer.alert(data.msg, {icon: 5});
 					$("#tbody").html("");
 				}
				
 			}
 		})
 	}
 	
 	
 	function exportExecl(){
 		 var startTime=$("#startTime").val();
		 var endTime=$("#endTime").val();
		 
		 $.ajax({
	 			type:"post",
	 			url:"${basePath}/print/printWorkTotal",
	 			data:{startTime:startTime,endTime:endTime},
	 			success:function(data){
	 				if(data.success){
	 					window.location.href="${basePath}/print/printStaticexportExcel?startTime="+startTime+"&endTime="+endTime+"";
	 				}else{
	 					layer.alert(data.msg, {icon: 5});
	 				}
	 			}
	 	})
 	}
	</script>

</body>
</html>
